-- GENERATED SPELL FOR [Amani'shi Medicine Man] --


function spell0_23581(pUnit, Event) --@Chain Heal,Heal--
pUnit:FullCastSpellOnTarget(42477,pUnit)
pUnit:RegisterEvent('Sorts_23581', 2500, 1)
end

function spell1_23581(pUnit, Event) --@Healing Ward,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(42376,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_23581', 1, 1)
end

function spell2_23581(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(45075,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23581', 2000, 1)
end

function spell3_23581(pUnit, Event) --@Protective Ward,Self--
pUnit:FullCastSpellOnTarget(42478,pUnit)
pUnit:RegisterEvent('Sorts_23581', 30000, 1)
end

function Sorts_23581(pUnit, Event)
local choix_sorts_23581 = math.random(0, 3)
if choix_sorts_23581 == 0 then
pUnit:RegisterEvent('spell0_23581', 1, 1)
end
if choix_sorts_23581 == 1 then
pUnit:RegisterEvent('spell1_23581', 1, 1)
end
if choix_sorts_23581 == 2 then
pUnit:RegisterEvent('spell2_23581', 1, 1)
end
if choix_sorts_23581 == 3 then
pUnit:RegisterEvent('spell3_23581', 1, 1)
end
end

function mob23581_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23581', math.random(1500, 3000), 1)
end

function mob23581_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23581_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23581_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23581, 1, 'mob23581_Action')
RegisterUnitEvent(23581, 2, 'mob23581_Leave')
RegisterUnitEvent(23581, 3, 'mob23581_Kill')
RegisterUnitEvent(23581, 4, 'mob23581_Die')
